package start.fly.test.servlet;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import start.fly.test.database.databaseTool;

public class ComMenUpdate extends HttpServlet{

@Override

protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
	response.setContentType("text/html;charset=GBK");
    PrintWriter out=response.getWriter();
	String pwd=request.getParameter("pwd");
	String email=request.getParameter("email");
	String usernumber=request.getParameter("usernumber");
	 if(pwd!=null&&email!=null&&usernumber!=null){
	      databaseTool data=new databaseTool();
	      boolean isUpdate=data.updateComMenInfoByManager(pwd,email, usernumber);
	      if(isUpdate){
	        out.print("<script>alert('修改企业会员信息成功');document.location='numberSystem/numberManage/companyMemberManage.jsp'</script>");
	      }else{
	        out.print("<script>alert('修改企业会员信息失败');document.location='numberSystem/numberManage/companyMemberManage.jsp'</script>");
	        }
	    }else{
	     out.print("<script>alert('输入框不能为空');document.location='numberSystem/numberManage/companyMemberManage.jsp'</script>");
	    }
}
@Override

protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
doPost(request, response);
}

}